package day05;

import java.util.Scanner;
import java.util.Arrays;
public class Practice02 {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);

        /*int score1 = 0;
        System.out.println("来做小学数学题,百分训练");
        for (int i = 0; i < 10; i++) {
            int b1 = (int) (Math.random() * 20);
            int b2 = (int) (Math.random() * 20);
            int result1 = b1 + b2;
            System.out.println("开始了");
            System.out.println(b1 + "+" + b2 + "=");
            int answer1 = s.nextInt();
            while (answer1 != result1) {
                System.out.println("打错了哦,在好好想想");
                System.out.println(b1 + "+" + b2 + "=");
                answer1 = s.nextInt();
            }
            if (answer1 == result1) {
                System.out.println("恭喜你答对了,加十分");
                score1 += 10;
            }
        }
        System.out.println("总分是"+score1+"哦一百分呢");*///20以内的随机加法题


        /*for (int i = 1; i <=10 ; i++) {
            for (int j = 1; j <=i ; j++) {
                System.out.print(j+"x"+i+"="+j*i+"\t");
            }
            System.out.println();
        }*///十十乘法表


        /*int[] arr = new int[15];//声明一个能存15个整数的数组
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * 1000 - 1);//0-999的一个随机数
            System.out.print(arr[i] + "\t");
        }
        System.out.println();
        int max = arr[arr.length - 1];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        System.out.println("最大值是" + max);
        System.out.println();
        Arrays.sort(arr);
        System.out.println("升序排列后");
        for (int j = 0; j < arr.length; j++) {
            System.out.print(arr[j] + "\t");
        }
        System.out.println();
        System.out.println();
        System.out.println("降序输出");
        for (int i =arr.length-1; i >=0 ; i--) {
            System.out.print(arr[i]+"\t");
        }
*///数组小代码练习：声明、初始化、访问、遍历,MaxOfArray求数组元素最大值, 对数组进行升序排列，并输出排序后的结果
    }
}
